home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 160 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.3 KB

  1. From: hv@compulink.co.uk (Hugo van der Sanden)
  2. Message-ID: <4eip8h$44s@zinc.compulink.co.uk>
  3. X-Original-Date: 29 Jan 1996 15:31:29 GMT
  4. Path: in2.uu.net!bounce-back
  5. Date: 29 Jan 96 15:53:00 GMT
  6. Approved: fjh@cs.mu.oz.au
  7. Newsgroups: comp.std.c++
  8. Subject: Sep '95 draft standard: meaning of 14.5
  9. Organization: CIX
  10. X-Newsreader: TIN [version 1.2 PL2h6]
  11. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  12.     iQBFAgUBMQzteuEDnX0m9pzZAQEOFwF/eeO93ReZFRgc7zBDjhV6Cd8nO6jexxBl
  13.     shGJWx5HoeI8cHPpNFLK8UY6S7pGlrwH
  14.     =Dm0Q
  15.  
  16. In section 5 of chapter 14 of the September '95 draft standard, it
  17. says this:
  18.   The prefix template <class T> specifies that a template is being
  19.   declared and that a type-name T will be used in the  declaration.
  20.  
  21. I'm unsure of the implications of the phrase 'will be used' in the
  22. above - does it imply 'will be used 1 or more times' or 'will be used
  23. 0 or more times'? In other words, is it an error to declare a template
  24. as:
  25.   template<class T> class useless {
  26.     int i;
  27.   public:
  28.     int get() { return i; }
  29.     void set(int j) { i=j; }
  30.   };
  31. such that 'T' is not used within the definition?
  32.  
  33. Any clarification would be appreciated,
  34.  
  35. Hugo van der Sanden
  36. ---
  37. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  38.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  39.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  40.